<%@ page language="java" isELIgnored="false"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Insert title here</title>
<link href="/admin/public/bootstrap.min.css" title="" rel="stylesheet" />
<link href="/admin/public/inspinia.css" rel="stylesheet" />
<link href="/admin/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" />
<link href="/admin/public/animate.css" rel="stylesheet" />
<link
	href="/admin/css/plugins/datetimepicker/bootstrap-datetimepicker.min.css"
	rel="stylesheet" media="screen" />
<link href="/admin/public/zTree/css/zTreeStyle/zTreeStyle.css"
	rel="stylesheet" />
<link href="/admin/js/multipleselect/multiple-select.css"
	rel="stylesheet" />
<link rel="stylesheet" href="/admin/css/Tab_swiper.css" />
<link rel="stylesheet" href="/admin/css/new_page_if.css" />
<link rel="stylesheet" type="text/css"
	href="${request.getContext }/admin/css/xcConfirm.css" />
<script src="/admin/My97/WdatePicker.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="/admin/public/html5shiv.min.js"></script>
	<script src="/admin/public/respond.min.js"></script>
<![endif]-->
<!-- 高德地图 -->
<link rel="stylesheet"
	href="http://cache.amap.com/lbs/static/main1119.css" />
<!-- 本地 -->
<script type="text/javascript"
	src="http://webapi.amap.com/maps?v=1.3&key=064fca579fe2d6c213c9c416d17b0a60&plugin=AMap.Autocomplete"></script>
	<!-- 百度编译器 -->
<script type="text/javascript" charset="utf-8" src="/admin/js/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/admin/js/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="/admin/js/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/admin/js/ueditor.all.min.js"></script>
<style>
th.prev {
	background: url(img/dateleft.png) -3px !important;
}

th.next {
	background: url(img/dateright.png) -10px !important;
}
.img{
	height: 200px;
	width:200px;
}
</style>
</head>
<body>
	<div
		style="width: 20px; height: 100%; position: relative; left: 16px; box-shadow: -5px 0 20px #8e9092;">
	</div>
	<div class="container-frame-detail" id="containerDetail"
		style="display: block; right: 0px; width: 780px; position: relative; bottom: 100%; left: 16px; height: 100%;">
		<div class="detail-inner" id="detailInner">
			<div class="slid-panel-header clearfix">
				<span class="panel-title">教练信息详情页</span> <span class="form-close-icon"></span>
			</div>
			<div class="detail_left">
				<div class="detail_left_inner">

					<!-- <div class="cus_simple_info">
                        <div class="tagSelector-warp">
                            <div class="tag-item-list">
                                <span class="tag-inputContainer"><span class="span-tag">+标签</span> </span>
                                <div class="tag-pullDown-container-down">
                                </div>
                            </div>
                        </div>
                    </div>-->
					<div class="customer_tabs fn-clear"
						style="margin-right: 30px; margin-left: 10px;">
						<ul class="detail_main_nav">
							<li><a class="slide-panel-tab slide_nav_hover"
								href="javascript:void(0)">教练信息详情页</a></li>
						</ul>
						<div class="detail_panels_main_body">
							<div id="renWu_msg" class="active">
								<form class="form-horizontal" id="upClient" enctype="multipart/form-data"
							novalidate="novalidate">
									<input type="hidden" name="userId" value="${userId }">
									<input type="hidden" name="olduserUrl" value="${userUrl }">
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;">*</span>姓名:</label>
										<div class="col-md-6 col-lg-6 col-sm-6">
											<input type="text" class="form-control" id="realname"
												name="realname" value="${realname }" >
										</div>
									</div>
									<%-- <div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;"></span>教练简介:</label>
										<div class="col-md-6 col-lg-6 col-sm-6">
											<input type="text" class="form-control" id="remark"
												name="remark" value="${remark }" >
										</div>
									</div> --%>
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;">*</span>教练简介:</label>
										<div class="col-md-6 col-lg-6 col-sm-6">
											<script id="editor1" type="text/plain" name="remark"  style="width:504px;height:200px;">${remark }</script>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;">*</span>手机号:</label>
										<div class="col-md-6 col-lg-6 col-sm-6">
											<input type="text" class="form-control" id="telenumber"
												name="telenumber" value="${telenumber }" >
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;">*</span>性别:</label>
										<div class="col-md-6 col-lg-6 col-sm-6">
											 <input type="radio" name="sex" value="2" ${(sex=='2')?'checked' : ''}/>&nbsp;女&nbsp;&nbsp;&nbsp;&nbsp;
								             <input type="radio" name="sex" value="1" ${(sex=='1')?'checked' : ''}/>&nbsp;男&nbsp;&nbsp;&nbsp;&nbsp;
		                                     <span class="field-validation-valid" data-valmsg-for="Title" data-valmsg-replace="true"></span>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"><span style="color:red;">*</span>教练头像:</label> 
										<div class="col-md-6 col-lg-6 col-sm-6">
											<input type="file" class="form-control" id="userUrl"
										name="userUrl" value="${userUrl }" onchange="preview(this,1)" >
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-2 col-sm-3 control-label"></label> 
										<div class="col-md-6 col-lg-6 col-sm-6">
											<div id="preview1">
												<img src="${userUrl }"  width="200px" height="200px"/>
											</div>
										</div>
									</div>
							</div>
								<a onclick="savePact();" class="btn btn-w-m btn-warning" style="float:right;margin-right:10px;">保存教练信息</a>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
	<script src="/admin/public/jquery-1.11.3.js"></script>
	<script src="/admin/js/plugins/lhgdialog/lhgdialog.js"></script>
	<!-- 时间控件样式 -->
	<script
		src="/admin/js/plugins/datetimepicker/bootstrap-datetimepicker.min.js"></script>
	<script
		src="/admin/js/plugins/datetimepicker/bootstrap-datetimepicker-update.min.js"></script>
	<script
		src="/admin/js/plugins/datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
	<!-- 弹出框 -->
	<script src="/admin/js/multipleselect/multiple-select.js"></script>
	<script src="${request.getContext }/admin/js/xcConfirm.js"
		type="text/javascript" charset="utf-8"></script>
	<!--    <script src="/admin/js/Tab_swiper.js"></script>-->
	<script src="/admin/js/new_page_if.js"></script>
	<script type="text/javascript">
	var ue=UE.getEditor('editor1');
		function preview(file, i) {
			var prevDiv = document.getElementById('preview' + i);
			//隐藏之前的图片
			if (file.files && file.files[0]) {
				var reader = new FileReader();
				reader.onload = function(evt) {
					prevDiv.innerHTML = '<img class="img" src="' + evt.target.result + '" />';
				}
				reader.readAsDataURL(file.files[0]);
			} else {
				prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
			}
		}
	</script>
	<script type="text/javascript">
		function check(){
			var realname = $("#realname").val();
			var telenumber = $("#telenumber").val();
			if(realname==null || realname==''){
				alert("姓名不得为空！");
				return false;
			}
			if (telenumber.length != 11) {
				alert('请输入有效的手机号码位数！', false);
				return false;
			}
			var myreg = /^(((13[0-9]{1})|(14[4,7])|(15[0-9]{1})|(17[6-8]{1})|(18[0-9]{1}))+\d{8})$/; 
			if (!myreg.test(telenumber)) {
				alert('请输入有效的手机号码！', false);
				return false;
			}
			return true;
			
		}
		//修改教练
		function savePact() { 
			if(check()){
				var formData = new FormData($( "#upClient" )[0]);  
			     $.ajax({  
			          url: '/admin/Employee/upEmployee' ,  
			          type: 'POST',  
			          data: formData,  
			          async: false,  
			          cache: false,  
			          contentType: false,  
			          processData: false,  
			          success: function (data) {  
			        	  if (data.success) {
								window.wxc.xcConfirm(data.msg, window.wxc.xcConfirm.typeEnum.info,{onOk:function(){ 
									window.parent.location.href="/admin/Employee/emlist";
						  		}})
							}else{
								alertNew(data.msg, false);
							}
			          },  
			          error: function (data) {  
			        	  alert("很抱歉，未知的错误发生了！"); 
			          }  
			     }); 
			}
		}
		
		
	</script>

</body>
</html>
